﻿/******************************************************************************
* Author: 671643387@qq.com
* @MR.Luo
*****************************************************************************/

#pragma once

#include <boost/pool/pool.hpp>

class EchoConnectionFactory : public dev::net::TcpConnectionFactory
{
public:
    EchoConnectionFactory();
    virtual ~EchoConnectionFactory();

public:
    virtual dev::net::TcpConnectionPtr createConnection(dev::net::sock_t sock, size_t isBufSize, size_t osBufSize);
private:
    void destroyConnection(dev::net::TcpConnection* conn);

#if defined(__LINUX__)
    void freeBuff(void* mem);
private:
    boost::pool<> bufPool_;
    boost::pool<> connPool_;
#endif
};

